<extend name="Public/base" />

<!-- 桌面商家新增和编辑页面 -->
<block name="body">
    <div class="main-title">
        <h2>平台秒杀活动</h2>
    </div>

    <div class="data-table table-striped">
        <table class="">
            <thead>
            <tr>
                <th class="row-selected row-selected"><input class="check-all" type="checkbox"></th>
                <th>活动名称</th>
                <th>活动时间</th>
                <th>活动规则</th>
                <th>可上传最大商品数</th>
                <th>状态</th>
                <th>报名状态</th>
                <th width="140" class="text-center">操作</th>
            </tr>
            </thead>
            <tbody>
            <notempty name="lists">
                <volist name="lists" id="vo">
                    <tr class="status_trclass_{$vo.status}">
                        <td><input class="ids" type="checkbox" name="ids[]" value="{$vo.id}" /></td>
                        <td><a href="{:U('index?&act_id='.$vo['id'])}" >{$vo.name}</a> </td>
                        <td>{:time_format($vo['start_time'], 'Y-m-d H:i:s')} 至 {:time_format($vo['expire_time'], 'Y-m-d H:i:s')}</td>
                        <td>{$vo.rule}</td>
                        <td class="text-center">{$vo.item_num}</td>
                        <td>
                            {$vo.status_text}
                            <if condition="$vo['start_time'] gt NOW_TIME">
                                <span class="text-danger">未开始</span>
                                <else/>
                                <if condition="$vo['expire_time'] gt NOW_TIME">
                                    <span class="text-success">进行中</span>
                                    <else/>
                                    <span class="text-cancel">已过期</span>
                                </if>
                            </if>
                        </td>
                        <td >

                            <if condition="$vo['seckill_status'] eq 2">
                                <span class="text-success">待审核</span>
                                <else/>
                                <if condition="$vo['seckill_status'] eq 1 || $vo['activity_status'] eq -2">
                                    <span class="text-success">报名成功</span>
                                    <else/>
                                    <if condition="$vo['seckill_status'] eq -1 || $vo['seckill_status'] eq 3 ">
                                        <span class="text-cancel">未通过</span>
                                        <else/>
                                        <span class="text-cancel">未报名</span>
                                    </if>
                                </if>
                            </if>
                        </td>
                        <td class="text-center">
                           <if condition="$vo['grade'] eq 0 ">
                               <span class="text-cancel">无资格</span>
                               <else/>
                             <if condition="($vo['grade'] eq 1 && $vo['seckill_status'] eq 1) || ($vo['grade'] eq 1 && $vo['seckill_status'] eq 3)  || ($vo['grade'] eq 1 && $vo['seckill_status'] eq 2) || ($vo['grade'] eq 1 && $vo['seckill_status'] eq -1)  ">
                               <span class="text-success"></span>
                               <else/>
                                <if condition = "$vo['activity_status'] eq -2">
                                    <span class=""></span>
                                    <else/>
                                    <a href="{:U('add?act_id='.$vo['id'].'&activity_status='.$vo['activity_status'].'&grade='.$vo['grade'])}" >[报名]</a>
                                </if>
                           </if>
                        </if>
                            <a href="{:U('index?&act_id='.$vo['id'])}" >[查看]</a>
                        </td>

                    </tr>
                </volist>
                <else/>
                <td colspan="12" class="text-center"> aOh! 暂时还没有内容! </td>
            </notempty>
            </tbody>
        </table>

    </div>
    <block>


        <block name="script">
            <script language="javascript" type="text/javascript" src="__PUBLIC__/Admin/js/My97Date/WdatePicker.js"></script>
            <script type="text/javascript" charset="utf-8">
                $(function(){
                    //导航高亮
                    highlight_subnav('{:U('index')}');
                    //时间选择
                    $('.date_select').focus(function(){
                        WdatePicker({skin: 'twoer', dateFmt: 'yyyy-MM-dd'});
                    });
                });
            </script>
        </block>
